package com.slz3.business.module.memberManagement.memRecord.steward;

import com.slz3.business.module.memberManagement.memRecord.domain.MemRecord;
import com.slz3.business.module.memberManagement.memRecord.domain.MemRecordCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class MemRecordResponse {

    public static Mono<ServerResponse> add(ServerRequest req) {
        return req.bodyToMono(MemRecord.class).flatMap(memRecord ->
                MemRecordResController.add(req, memRecord)
        );
    }

    public static Mono<ServerResponse> delete(ServerRequest req) {
        return req.bodyToMono(MemRecordCondition.class).flatMap(memRecordCondition ->
                MemRecordResController.delete(req, memRecordCondition)
        );
    }

    public static Mono<ServerResponse> modify(ServerRequest req) {
        return req.bodyToMono(MemRecord.class).flatMap(memRecord ->
                MemRecordResController.modify(req, memRecord)
        );
    }


    public static Mono<ServerResponse> list(ServerRequest req) {
        return MemRecordResController.list(req);
    }

    public static Mono<ServerResponse> info(ServerRequest req) {
        return MemRecordResController.info(req);
    }

    public static Mono<ServerResponse> choice(ServerRequest req) {
        return MemRecordResController.choice(req);
    }

    public static Mono<ServerResponse> auditSubmit(ServerRequest req) {
        return req.bodyToMono(MemRecordCondition.class).flatMap(memRecordCondition ->
                MemRecordResController.auditSubmit(req, memRecordCondition)
        );
    }

    public static Mono<ServerResponse> audit(ServerRequest req) {
        return req.bodyToMono(MemRecordCondition.class).flatMap(memRecordCondition ->
                MemRecordResController.audit(req, memRecordCondition)
        );
    }

    public static Mono<ServerResponse> auditReject(ServerRequest req) {
        return req.bodyToMono(MemRecordCondition.class).flatMap(memRecordCondition ->
                MemRecordResController.auditReject(req, memRecordCondition)
        );
    }

    public static Mono<ServerResponse> usingEnable(ServerRequest req) {
        return req.bodyToMono(MemRecordCondition.class).flatMap(memRecordCondition ->
                MemRecordResController.usingEnable(req, memRecordCondition)
        );
    }

    public static Mono<ServerResponse> usingDisable(ServerRequest req) {
        return req.bodyToMono(MemRecordCondition.class).flatMap(memRecordCondition ->
                MemRecordResController.usingDisable(req, memRecordCondition)
        );
    }   

}
